<?php
/**
 * add vicleo 20170205 后台登录用的中间件
 */
namespace App\Http\Middleware;

use Closure;

class AdminLogin
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        //start check login for admin
        if (!session('adminUser')) {
            //You need login
            return redirect('admin/login');
        }
        return $next($request);
    }
}
